package com.xxgc.demo.controller.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @Author:lxy
 * @create 2023/9/7 21:14
 */
@Schema(description = "用户注册VO")
@Data
public class UserInfoRegisterVO {

    @NotNull(message = "用户名不能为空")
    @Size(min = 2,max = 6,message = "用户名必须在2-6位")
    @Schema(description = "用户名",requiredMode = Schema.RequiredMode.REQUIRED)
    private String userName;

    @NotNull(message = "密码不能为空")
    @Size(min = 8,max = 20,message = "密码必须在8-20位")
    @Pattern(regexp = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).*$",message = "密码必须包含大小写和数字")
    @Schema(description = "密码",requiredMode = Schema.RequiredMode.REQUIRED)
    private String passWord;

    @NotNull(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$",message = "手机号不正确，请输入中国的手机号")
    @Schema(description = "手机号",requiredMode = Schema.RequiredMode.REQUIRED)
    private String phoneNumber;
}
